package linkList;

import exceptions.BadDataException;
import exceptions.EmptyLinkedListException;
import exceptions.OutOfLinkedListException;

public interface ILinkedList {

	/**
	 * Adds a new node in the beginning, filling it with given data.
	 * 
	 * @param data
	 *            - data to be added in the beginning
	 * @throws BadDataException
	 *             - when null is passed
	 */
	public void add(Object data) throws BadDataException;
	
	/**
	 * Gets an element of given index.
	 * 
	 * @param index
	 *            - the index of element
	 * @return - the element's data at that position
	 * @throws OutOfLinkedListException
	 *             - when the index is above the size and below 0
	 * @throws EmptyLinkedListException
	 *             - when the list is empty
	 */
	public Object get(int index) throws OutOfLinkedListException,
			EmptyLinkedListException;
		
		/**
		 * Gets the number of elements in the linked list.
		 * 
		 * @return - int representing this number
		 */
	public int getSize();
	
	/**
	 * Removes the first element of the linked list.
	 * @return - the data in this eement
	 * @throws EmptyLinkedListException 
	 */
	public Object removeFirs() throws EmptyLinkedListException;
	
}
